<?php
namespace Amis\form;
class ChainedSelect extends FormItem
{
    public string $type = 'select3';

    public function options($options)
    {
        $this->options = $options;
        return $this;
    }

    public function source($api)
    {
        $this->source = $api;
        return $this;
    }

    public function autoComplete($autoComplete)
    {
        $this->autoComplete = $autoComplete;
        return $this;
    }

    public function delimiter(string $delimiter = ',')
    {
        $this->delimiter = $delimiter;
        return $this;
    }

    public function labelField(string $labelField)
    {
        $this->labelField = $labelField;
        return $this;
    }

    public function valueField(string $valueField)
    {
        $this->valueField = $valueField;
        return $this;
    }

    public function joinValues(bool $joinValues = true)
    {
        $this->joinValues = $joinValues;
        return $this;
    }

    public function extractValue(bool $extractValue = false)
    {
        $this->extractValue = $extractValue;
        return $this;
    }
}